求根节点到叶节点数字之和
https://leetcode.cn/problems/sum-root-to-leaf-numbers/description/
class Solution {
public:
    int dfs(TreeNode* root , int preSum)
    {
        preSum*=10;
        preSum+=root->val;
        
        if(root->left==nullptr && root->right==nullptr )
            return preSum;
        
        int left=0,right=0;
        if(root->left)
            left=dfs(root->left,preSum);
        if(root->right)
            right=dfs(root->right,preSum);
        return left + right;
    }


    int sumNumbers(TreeNode* root) {
        
        return dfs(root,0);
    }
};